package Socket;

import java.util.Arrays;

/**
 * 测试从数组中删除元素
 */
public class Test {
    public static void main(String[] args) {
        int []allOut={1,25,3,6,884,51,552,4,56,44,5,55};
        int pw =6;
        System.out.println(Arrays.toString(allOut));
        //将pw的值从allOut数组中删除
        for (int i = 0; i <allOut.length ; i++) {
            if (allOut[i]==pw){
                allOut[i]=allOut[allOut.length-1];
                break;
            }
        }
        allOut=Arrays.copyOf(allOut,allOut.length-1);

        System.out.println(Arrays.toString(allOut));
    }
}
